package main.java.com.zzxy.springmvc12.controller;

@Controller
public class StudentController {
    public String register() {
        return "/user/register";
    }

    public @ResponseBody Student insert(@RequestBody Student student) {
        student.setPassword(student.getPassword()+":qwe");
        student.setUsername(student.getUsername()+":asd");
        //service  >  MyBatis
        return student;
    }

    public String addStu(String username,String password) {
        System.out.println(username);
        System.out.println(password);
        // service >  dao > insert into student ...
        return "/user/userList";
    }

    public String addStu1(Student student) {
        System.out.println(student);
        // service >  dao > insert into student ...
        return "/user/userList";
    }

    public String addStu2(StudentExt ext) {
        System.out.println(ext);
      /*  for (Student student : ext.getStudentList()) {
            System.out.println(student);
        }*/
        // service >  dao > insert into student ...
        return "/user/userList";
    }

    public String test() {
        return "forward:/register.do";
    }

    public String test1() {
        return "redirect:/register.do";
    }
}
